<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/10/11
 * Time: 13:52
 */

class Face implements FaceInterface{
    public function __construct(Dvd $dvd, Music $music, Photo $photo, Tv $tv)
    {
        $this->dvd  = $dvd;
        $this->music= $music;
        $this->photo= $photo;
        $this->tv   = $tv;
    }

    public function open() {
        $this->tv->open();
        $this->tv->run();
        $this->photo->open();
        $this->photo->change();
        $this->photo->setWidth();
        $this->music->open();
        $this->music->setRound();
        $this->music->setSound();
        $this->music->changeDvd();
        $this->dvd->open();
        $this->dvd->run();
    }
    public function close() {
        $this->dvd->unRun();
        $this->dvd->close();
        $this->music->close();
        $this->photo->close();
        $this->tv->unRun();
        $this->tv->close();
    }
}